-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
examples/watrli_rpl_udp: initial commit [DO NOT MERGE, just 4 testing] #5
base: master
Are you sure you want to change the base?
Conversation
311a71e
to
12fc236
Compare
12fc236
to
a1c0761
Compare
int sock; | ||
sockaddr6_t sa; | ||
int bytes_sent; | ||
sock = socket_base_socket(PF_INET6, SOCK_DGRAM, IPPROTO_UDP); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I'm not mistaken, this creates a new socket every time is is used to send a packet... Is this intentional? If so, why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yup every-time a new socket.
There's no real reason for that. My initial intention was to use this function only once for testing purposes.
So the function prototype could be changed to e.g.
static void watr_li_udp_send(int sock, char* payload, size_t payload_size)
and the socket_base_close(sock);
at the end of this function should be removed then.
The socket then can be created for instance here and provided as parameter here (with the new prototype).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The main has changed a bit in the plant_node master anyway.. ;) I'd create the socket in watr_li_setup_node() and close it at the end of my new main. Thanks for the quick response!
f00e536
to
e03cf69
Compare
e827c84
to
e25af3d
Compare
…e desired global address
e25af3d
to
6d82ec1
Compare
This is a small example initializing RPL on a node and starting an UDP server.
After 30sec a message is sent to the DODAG root (DAG-ID)